home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Revista CD Expert 32
/
CD Expert nº 32.iso
/
Army Men TiS
/
data1.cab
/
Required_Files
/
rules
/
node_common.txt
< prev
next >
Wrap
Text File
|
1999-10-08
|
5KB
|
169 lines
//////////////////////////////////////////////////////////////////////////////
// Node control rules common to node and fusion
//////////////////////////////////////////////////////////////////////////////
// @1 = node number (1-5)
macro node_macro 1
{
// 0 = no owner, 1 = green, 2 = tan, 3 = blue, 4 = grey
variable node@1owner 0
variable oldnode@1owner 0
variable node@1holder 0
if startup1 then
deploy blacknode@1,
setitemflag blacknode@1 stratsquare 1,
setitemflag blacknode@1 strategic 1
if node@1OwnerChanged testvar oldnode@1owner = 0 then
undeploy blacknode@1,
setitemflag blacknode@1 strategic 0,
trigger showNewNode@1Owner
// whenever node@1owner changes create explosions to make flags appear/dissapper in a
// puf of smoke
if node@1OwnerChanged then
createexplosion greennode@1 128 0 green
// if there is a new node@1 owner then play a sound
if showNewNode@1Owner testvar node@1owner <> 0 then
playsound "mp_own.wav" (0,0) 1 2
}
expand node_macro ( 1 )
expand node_macro ( 2 )
expand node_macro ( 3 )
expand node_macro ( 4 )
expand node_macro ( 5 )
// @1 = color, @2 = Capitalized color (e.g. "Green"), @3 is value for node owner,
// @4 = node number (1-5),
// @5-7 = other colors
macro team_node_macro 7
{
variable @1onnode@4 0
// these pairs of variables are used to prevent sarge leaving and returning to the node within
// 1 second and scoring at a double rate
variable @1GainsNode@4Count 0
variable @1KeepsNode@4Check 0
pad @1node@4pad @4 @1 unit > 0
if startup1 testvar iscoloringame @1 > 0 then
setitemflag @1node@4 stratsquare 1,
setitemowner @1node@4 @1
// check for @1 taking or losing this node
if padon @1node@4pad then
setvar @1onnode@4 1,
trigger check@1holdsnode@4
if padoff @1node@4pad then
setvar @1onnode@4 0,
trigger @1offnode@4
if @1offnode@4 testvar node@4holder = @3 then
setvar node@4holder 0,
trigger check@5holdsnode@4,
trigger check@6holdsnode@4,
trigger check@7holdsnode@4
if check@1holdsnode@4 testvar @1onnode@4 = 1 and node@4holder = 0 then
setvar node@4holder @3,
trigger check@1ownsnode@4
if check@1ownsnode@4 testvar node@4owner <> @3 and node@4holder = @3 then
setvar node@4owner @3,
trigger node@4OwnerChanged,
showmessage "@2 takes control of node @4",
addvar @1GainsNode@4Count 1,
triggerdelay refvar nodeScoreDelay check@1node@4scoresinitial
if check@1node@4scoresinitial then
addvar @1KeepsNode@4Check 1
if check@1node@4scoresinitial testvar node@4owner = @3 then
trigger check@1node@4scores
if check@1node@4scores testvar node@4owner = @3 and @1KeepsNode@4Check = @1GainsNode@4Count then
trigger increment@1score,
playsound "mp_tick.wav" (0,0) 2 3,
trigger check@1wins,
triggerdelay refvar nodeScoreDelay check@1node@4scores
// update the flags to display the owner of node@4
if node@4OwnerChanged testvar oldnode@4owner = @3 and node@4owner <> @3 then
trigger decrement@1nodesOwned,
undeploy @1node@4,
setitemflag @1node@4 strategic 0,
trigger showNewNode@4Owner,
removescoresymbol @1 @1node
if showNewNode@4Owner testvar node@4owner = @3 and oldnode@4owner <> @3 then
setvar oldnode@4owner @3,
trigger increment@1nodesOwned,
deploy @1node@4 blacknode@4,
setitemflag @1node@4 strategic 1,
addscoresymbol @1 @1node
}
// @1 = color, @2 = Capitalized color (e.g. "Green"), @3 is value for node owner,
// @4-6 are other colors
macro node_control_macro 6
{
variable @1nodesOwned 0
if increment@1score testvar @1nodesOwned = 1 then
addvar @1score own1NodeBonus
if increment@1score testvar @1nodesOwned = 2 then
addvar @1score own2NodesBonus
if increment@1score testvar @1nodesOwned = 3 then
addvar @1score own3NodesBonus
if increment@1score testvar @1nodesOwned = 4 then
addvar @1score own4NodesBonus
if increment@1score testvar @1nodesOwned = 5 then
addvar @1score own5NodesBonus
expand team_node_macro ( @1 "@2" @3 1 @4 @5 @6 )
expand team_node_macro ( @1 "@2" @3 2 @4 @5 @6 )
expand team_node_macro ( @1 "@2" @3 3 @4 @5 @6 )
expand team_node_macro ( @1 "@2" @3 4 @4 @5 @6 )
expand team_node_macro ( @1 "@2" @3 5 @4 @5 @6 )
}
expand node_control_macro ( green "Green" 1 tan blue grey )
expand node_control_macro ( tan "Tan" 2 blue grey green )
expand node_control_macro ( blue "Blue" 3 grey green tan )
expand node_control_macro ( grey "Grey" 4 green tan blue )
// @1 = color of player, @2 = color of possible ally
macro nodes_owned_team_macro 2
{
if increment@1nodesOwned testvar isally @1 @2 = 1 then
addvar @2nodesOwned 1
if decrement@1nodesOwned testvar isally @1 @2 = 1 then
addvar @2nodesOwned -1
}
// @1 = color of player, @2-4 = color of other players
macro nodes_owned_macro 4
{
expand nodes_owned_team_macro ( @1 @1 )
expand nodes_owned_team_macro ( @1 @2 )
expand nodes_owned_team_macro ( @1 @3 )
expand nodes_owned_team_macro ( @1 @4 )
}
expand nodes_owned_macro ( green tan blue grey )
expand nodes_owned_macro ( tan blue grey green )
expand nodes_owned_macro ( blue grey green tan )
expand nodes_owned_macro ( grey green tan blue )